
import 'dart:convert';
import 'package:flutter/material.dart';

BookFilter bookFiltersFromJson(String str) =>
    BookFilter.fromJson(json.decode(str));

String bookFiltersToJson(BookFilter data) => json.encode(data.toJson());

class BookFilter {
  BookFilter({
    this.label,
    this.value,
    this.type,
    this.secondLastNode,
    this.children,
  });

  String? label;
  dynamic value;
  String? type;
  bool? secondLastNode;
  List<BookFilter>? children;

  factory BookFilter.fromJson(Map<String, dynamic> json) => BookFilter(
        label: json["label"],
        value: json["value"],
        type: json["type"],
        //secondLastNode: json["secondLastNode"]!=null ? json["secondLastNode"]: false,
        children: json["children"] != null
            ? List<BookFilter>.from(
                json["children"].map((x) => BookFilter.fromJson(x)))
            : [],
      );

  Map<String, dynamic> toJson() => {
        "label": label,
        "value": value,
        "type": type,
        //"secondLastNode": secondLastNode!=null ? secondLastNode: false,
        "children": children != null
            ? List<dynamic>.from(children!.map((x) => x.toJson()))
            : null,
      };

  map(DropdownMenuItem<Object> Function(dynamic folder) param0) {}
}
